#include "../images/ui.h"
lv_obj_t * ui_uiabout;
lv_obj_t * ui_uiabout_Label1;
lv_obj_t * ui_uiaboutLabel2;
lv_obj_t * ui_uiaboutLabel3;
lv_obj_t * ui_uiaboutLabel4;
void ui_event_back_point(lv_event_t * e)
{
    lv_event_code_t event_code = lv_event_get_code(e);
    lv_obj_t * target = lv_event_get_target(e);
    if(event_code == LV_EVENT_GESTURE)
    {
         if(lv_indev_get_gesture_dir(lv_indev_get_act()) == LV_DIR_LEFT)
        {
             lv_scr_load_anim(ui_SettingsUnit,LV_SCR_LOAD_ANIM_NONE, 10, 0,true);
             lv_indev_wait_release(lv_indev_get_act());

         }
    }
}
void ui_uiabout_screen_init(void)
{
    ui_uiabout = lv_obj_create(NULL);
    lv_obj_clear_flag(ui_uiabout, LV_OBJ_FLAG_SCROLLABLE);      /// Flags
    lv_obj_set_style_bg_color(ui_uiabout, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(ui_uiabout, 255, LV_PART_MAIN | LV_STATE_DEFAULT);

    ui_uiabout_Label1 = lv_label_create(ui_uiabout);
    lv_obj_set_width(ui_uiabout_Label1, LV_SIZE_CONTENT);   /// 1
    lv_obj_set_height(ui_uiabout_Label1, LV_SIZE_CONTENT);    /// 1
    lv_obj_set_x(ui_uiabout_Label1, -12);
    lv_obj_set_y(ui_uiabout_Label1, -114);
    lv_obj_set_align(ui_uiabout_Label1, LV_ALIGN_CENTER);
    lv_label_set_text(ui_uiabout_Label1, "About");
    lv_obj_set_style_text_color(ui_uiabout_Label1, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui_uiabout_Label1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui_uiabout_Label1, &lv_font_montserrat_20, LV_PART_MAIN | LV_STATE_DEFAULT);

    ui_uiaboutLabel2 = lv_label_create(ui_uiabout);
    lv_obj_set_width(ui_uiaboutLabel2, LV_SIZE_CONTENT);   /// 1
    lv_obj_set_height(ui_uiaboutLabel2, LV_SIZE_CONTENT);    /// 1
    lv_obj_set_x(ui_uiaboutLabel2, 10);
    lv_obj_set_y(ui_uiaboutLabel2, 130);
    lv_label_set_text(ui_uiaboutLabel2, "Software Version: V1.0");
    lv_obj_set_style_text_color(ui_uiaboutLabel2, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui_uiaboutLabel2, 255, LV_PART_MAIN | LV_STATE_DEFAULT);

    ui_uiaboutLabel3 = lv_label_create(ui_uiabout);
    lv_obj_set_width(ui_uiaboutLabel3, LV_SIZE_CONTENT);   /// 1
    lv_obj_set_height(ui_uiaboutLabel3, LV_SIZE_CONTENT);    /// 1
    lv_obj_set_x(ui_uiaboutLabel3, 10);
    lv_obj_set_y(ui_uiaboutLabel3, 100);
    lv_label_set_text(ui_uiaboutLabel3, "Hardware Version: V1.0");
    lv_obj_set_style_text_color(ui_uiaboutLabel3, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui_uiaboutLabel3, 255, LV_PART_MAIN | LV_STATE_DEFAULT);

    ui_uiaboutLabel4 = lv_label_create(ui_uiabout);
    lv_obj_set_width(ui_uiaboutLabel4, LV_SIZE_CONTENT);   /// 1
    lv_obj_set_height(ui_uiaboutLabel4, LV_SIZE_CONTENT);    /// 1
    lv_obj_set_x(ui_uiaboutLabel4, 10);
    lv_obj_set_y(ui_uiaboutLabel4, 160);
    lv_label_set_text(ui_uiaboutLabel4, "manufacturer: ZhiLan Tech");
    lv_obj_set_style_text_color(ui_uiaboutLabel4, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui_uiaboutLabel4, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
    lv_obj_add_event_cb(ui_uiabout, ui_event_back_point, LV_EVENT_ALL, NULL);

}
void about_caller(lv_event_t *e)
{
    ui_uiabout_screen_init();
    lv_disp_load_scr(ui_uiabout);


}